package com.dc.designPattern._17_mediator.impl;

/**
 * Description: 中介者模式_具体同事类_闹铃
 * @author: gdc
 * @date: 2021/6/2
 * @version 1.0
 */
public class Alarm extends Colleague {

    public Alarm(Mediator mediator, String name) {
        super(mediator, name);

        // 在创建 Alarm 对象同时，将自己放入到 ConcreteMediator 集合中
        mediator.register(name, this);
    }

    public void sendAlarm(int stateChange) {
        System.out.println("闹铃响了...");

        sendMessage(stateChange);
    }

}
